﻿<!--#include file="../inc/common.asp" -->
<%
'????????????
'
'???????????????../emoticons???е???????????????HTML?????????
'???????????μ????????轫??????????../emoticons???м???
'
'author: evan zhao
'

response.AddHeader "Last-Modified", DateToGMT(Now())
response.Expires = 120
response.CacheControl = "public"

const EM_PAGE_SIZE=100

const FACE_PATH ="../emoticons/"
  
%>
<html>
<head>
<script language=javascript>
function clickFace(imgObj){
    parent.parent._CEmoticonRenderer_Select(imgObj);
}    
function hidePopup(){
    parent.parent._CPopup_Hide()
}
</script>
</head>
<body onload="window.focus()">
<%

dim fsObj, folderObj, files

set fsObj=Server.createObject("Scripting.FileSystemObject")

'???????Folder????
set folderObj=fsObj.getFolder(Server.mapPath(FACE_PATH))

set files = folderObj.files

'?????????????


dim totalCount, imgFile, start,  count, i, totalPage

totalCount = files.count

start = request("start")
if start<>"" then
    start = clng(start)
    if start<0 then
        start=0 
    end if
else
    start=0    
end if

count = EM_PAGE_SIZE
if count>totalCount then
    count = totalCount
end if

totalPage = (totalCount + EM_PAGE_SIZE -1) \ EM_PAGE_SIZE

sub writePage
    response.write("???:&nbsp;")
    
    for i=1 to totalPage 
        if start<>(i-1)*EM_PAGE_SIZE then
    %>
    <a href="?start=<%=(i-1)*EM_PAGE_SIZE%>"><%=i%></a>&nbsp;
    <%
        else
            response.write(i&"&nbsp;")
        end if
    next
end sub
call writePage

response.write("<br>")

i=0
for each imgFile in files
    if i > start+count-1 then
        exit for
    end if
    if i>=start then
%>
<img src="<%=FACE_PATH%><%=imgFile.name%>" ONCLICK="clickFace(this)" style="cursor:hand">
<%
    end if
    i = i+1
Next

set fsObj = Nothing

response.write("<br>")
call writePage

%>

<p align=center>
<input type=button value=" ??? " onclick="document.location.reload()"> &nbsp;
<input type=button value=" ??? " onclick="hidePopup()">
</p>
</body>
</html>
<!--#include file="../inc/end.asp" -->